package Demo;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Demo53 {
    public static void main(String[] args) {
        String str="i4649love49419674987you";
        String regx="[0-9]+";
        Pattern pattern=Pattern.compile(regx);
        String[] str1=pattern.split(str);
        for (int i = 0; i <str1.length ; i++) {
            System.out.println(str1[i]);
        }
        String str2="101";
        String regx1="\\d+";
        Pattern pat=Pattern.compile(regx1);
        Matcher match=pat.matcher(str2);
        System.out.println(match.matches());
        String str3="i&%love)*%$you";
        String regx2="[^a-z]+";
        Pattern pat1=Pattern.compile(regx2);
        Matcher mat= pat1.matcher(str3);
        System.out.println(mat.replaceAll(" "));
    }
}
